package cn.portx.frame.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.bstek.bdf3.saas.domain.Organization;

import cn.portx.ICallback;

@Service
public class OrganizationDBServiceImpl {

	@Transactional(propagation = Propagation.REQUIRES_NEW)
	public <T> T doDb(Organization org, ICallback<T, Organization> callback) {
		return callback.execute(org);
	}

	@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = true)
	public <T> T doDbReadOnly(Organization org, ICallback<T, Organization> callback) {
		return callback.execute(org);
	}

}
